import 'package:bruno/bruno.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:sph_driver/Main/CustomerService/InitiateComplaint.dart';

import '../../AppConfig/Config.dart';
import '../../AppConfig/RouteAct.dart';
import '../../l10n/messages.dart';
import '../ServiceHall/Feedback.dart';
import 'SelectComplaintForm.dart';
import 'ServiceProgress.dart';

class TransactionDisputes extends StatefulWidget {
  const TransactionDisputes({super.key});

  @override
  State<TransactionDisputes> createState() => _TransactionDisputesState();
}

class _TransactionDisputesState extends State<TransactionDisputes> {

  List qaTitleList=["线下交易产生费用纠纷怎么办？","货主已确认收货，订金怎么还没到账？","怎么修改驾驶证、行驶证证件上传？","货运险是什么？","未结算到运费？","怎么发起投诉？"];

  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    var messages = AppLocalizations.of(context)!;
    return Scaffold(
      appBar: AppBar(

        backgroundColor:Color(0xFFFBECE4),
        centerTitle: true,
        title: Text(messages['交易纠纷'],style: TextStyle(color: Colors.black,fontWeight: FontWeight.w300,fontSize: 16.sp,)),
      ),
      body: Container(
        padding: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h),
        decoration: BoxDecoration(
          gradient: LinearGradient(
            colors: [Color(0xFFFBECE4),MyColors.backgreyColor],
            begin: Alignment.topCenter,
            end: Alignment(0.0, -0.55),
          ),
        ),
        child: ListView(
          children: [
            Container(
              padding: EdgeInsets.all(20.w),
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(10)),
              ),
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      BrnIconButton(
                          name: messages["发起投诉"],
                          style: TextStyle(
                            fontSize: 13.sp,
                            color: Colors.black,
                          ),
                          direction: Direction.bottom,
                          padding: 4.h,
                          iconHeight: 30.h,
                          iconWidth: 30.w,
                          iconWidget: Image.asset("lib/Images/PersonCenter/发起投诉.png"),
                          onTap: () {
                            Navigator.push( context, FadeRoute(page:InitiateComplaint()));
                          }),
                      BrnIconButton(
                          name: messages["催促投诉"],
                          style: TextStyle(
                            fontSize: 13.sp,
                            color: Colors.black,
                          ),
                          direction: Direction.bottom,
                          padding: 4.h,
                          iconHeight: 30.h,
                          iconWidth: 30.w,
                          iconWidget: Image.asset("lib/Images/PersonCenter/催促投诉.png"),
                          onTap: () {
                            Navigator.push( context, FadeRoute(page:SelectComplaintForm(chooseType: 1,)));
                          }),
                      BrnIconButton(
                          name: messages["取消投诉"],
                          style: TextStyle(
                            fontSize: 13.sp,
                            color: Colors.black,
                          ),
                          direction: Direction.bottom,
                          padding: 4.h,
                          iconHeight: 30.h,
                          iconWidth: 30.w,
                          iconWidget: Image.asset("lib/Images/PersonCenter/取消投诉.png"),
                          onTap: () {
                            Navigator.push( context, FadeRoute(page:SelectComplaintForm(chooseType: 2,)));
                          }),
                      BrnIconButton(
                          name: messages["进度查询"],
                          style: TextStyle(
                            fontSize: 13.sp,
                            color: Colors.black,
                          ),
                          direction: Direction.bottom,
                          padding: 4.h,
                          iconHeight: 30.h,
                          iconWidth: 30.w,
                          iconWidget: Image.asset("lib/Images/PersonCenter/进度查询.png"),
                          onTap: () {
                            Navigator.push( context, FadeRoute(page:ServiceProgress()));
                          }),
                    ],
                  ),
                  SizedBox(height: 8.h,),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      BrnIconButton(
                          name: messages["补充凭证"],
                          style: TextStyle(
                            fontSize: 13.sp,
                            color: Colors.black,
                          ),
                          direction: Direction.bottom,
                          padding: 4.h,
                          iconHeight: 30.h,
                          iconWidth: 30.w,
                          iconWidget: Image.asset("lib/Images/PersonCenter/补充凭证.png"),
                          onTap: () {
                            Navigator.push( context, FadeRoute(page:SelectComplaintForm(
                              chooseType: 3,
                            )));
                          }),

                    ],
                  ),
                ],
              ),
            ),
            SizedBox(height: 8.h,),
            Container(
              height: qaTitleList.length *38.h,
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(10)),
              ),
              child: ListView.builder(
                physics: NeverScrollableScrollPhysics(),
                shrinkWrap:false,
                itemCount: qaTitleList.length,
                itemBuilder: (BuildContext context, int index) {
                  return Container(
                    padding: EdgeInsets.only(left: 8.w,right: 8.w,),
                    child:GestureDetector(
                      child:   Column(
                        children: [
                          SizedBox(height: 10.h,),
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [

                              Text(qaTitleList[index],style: TextStyle(color: Colors.black),),

                            ],
                          ),
                          SizedBox(height: 10.h,),
                          Container(
                            height: 1.h,
                            color: MyColors.backgreyColor,
                          ),
                        ],
                      ),
                      onTap: (){

                      },
                    ),
                  );
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}
